// 2021/4/27

const obj = {

    status: "start",

    fun: function(tag, value) {
        console.log(`Involved with tag ${tag}`);
        console.log(value);
    }
};

const bindedObj = Object.entries(obj).map(entry => {
    const name = entry[0];
    let value = entry[1];
    if (typeof value == 'function') {
        value = value.bind(this, "bind");
    }
    return [name, value];
}).reduce((accumulator, currentEntry) => {
    accumulator[currentEntry[0]] = currentEntry[1];
    return accumulator;
}, {});

obj.fun("original", "Hello world");
bindedObj.fun("Hello world");



